package com.agadmin.config;

import com.agadmin.entity.user.Users;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.util.Collection;

public class CustomUser extends User {
    public CustomUser(Users sysUser, Collection<? extends GrantedAuthority> authorities) {
        super(sysUser.getUserName(), sysUser.getPassword(), authorities);
        this.sysUser=sysUser;
    }
    /**
     * 我们自己的用户实体对象，要调取用户信息时直接获取这个实体对象。
     */
    private Users sysUser;

    public Users getSysUser() {
        return sysUser;
    }

    public void setSysUser(Users sysUser) {
        this.sysUser = sysUser;
    }
}
